<template>
  <table>
    <el-input
      v-model.trim="username"
      style="width: 240px"
      placeholder="账号名/手机号/邮箱"
      class="username-input"
    /><br />
    <el-input
      v-model.trim="password"
      style="width: 240px"
      type="password"
      placeholder="密码"
      show-password
      class="password-input"
      @keyup.enter="handleLogin"
    /><br />
    <el-button
      type="primary"
      style="width: 100%"
      class="login-btn"
      @click="handleLogin"
      >登录</el-button
    ><br />
    <slot></slot>
  </table>
</template>

<script setup>
import { ref } from 'vue'
import { storeToRefs } from 'pinia';
import { useMapgisStore_hjh } from '@/stores/mapgis-hjh'
const mapgisStore_hjh = useMapgisStore_hjh()
const { handleLogin } = mapgisStore_hjh
const { username, password } = storeToRefs(mapgisStore_hjh)
</script>

<style lang="scss" scoped>
table {
  margin: 30px auto;
  text-align: center;
  .username-input {
    margin-bottom: 16px;
  }
  .password-input {
    margin-bottom: 36;
  }
  .login-btn {
    margin-top: 20px;
    margin-bottom: 10px;
  }
}
</style>
